package com.kuang.demo3.impl;

import com.kuang.demo3.Shape;

import java.util.Scanner;

/**
 * @Title:
 * @Description:
 * @Author: zx
 * @Date: create in 11:20 2020/8/7
 * @Version: 1.0
 */
public class Circle implements Shape {

    //半径
    private int r;

    @Override
    public Object clone() {
        Circle circle = null;
        try {
            circle = (Circle) super.clone();
        } catch (CloneNotSupportedException e) {
            System.out.println("拷贝圆失败!");
        }
        return circle;
    }

    @Override
    public void countArea() {
        System.out.print("这是一个圆，请输入圆的半径：");
        Scanner input=new Scanner(System.in);
        r=input.nextInt();
        System.out.println("该圆的面积="+Math.PI*r*r+"\n");
    }
}
